const mongoConnected = require("../lib/mongoose_connect");
const mongoModels = require("../lib/mongoose_schemas");
const fs = require("fs-extra");
const path = require("path");
const lodash = require("lodash");
const Data081501 = require("../test/0815-每个玩家的参与数和平均排名.json")

mongoConnected.then(async $ => {
  //  let d = Data081501.sort((a,b)=>b.ave_ranking-a.ave_ranking).filter(e=>e.match_count>=20);
  //  let d2 = Data081501.filter(e=>e.qianwu>=20).sort((a,b)=>b.qianwu-a.qianwu);
  //  let d3 = Data081501.sort((a,b)=>b.ave_qianwu-a.ave_qianwu);
  let b = Data081501.filter(e => e.match_count >= 20);
  let sort1 = b.sort((a, b) => b.qianwu - a.qianwu)
  debugger
  for (let p of sort1) {
    console.log(p.name, "|", p.qianwu, "|", p.match_count, "|",
      Math.round(p.ave_ranking * 100) / 100, "|",
      Math.round(p.ave_qianwu * 100) / 100, "|", p.account_id)
  }
})

